<style lang="scss" scoped>
@import '@/assets/css/uno.scss';
</style>

<template>
	<view class="bgfff mb8 br8 p12 bs df jcsb aic" @tap="onToPage(item.code)">
		<view class="left dfc">
			<view class="">{{ item.name }}</view>
			<view v-if="type == 0" class="fs12 c999">
				{{ item.bigName }}{{ item.middleName ? '&nbsp;>&nbsp;' + item.middleName : '' }}
			</view>
		</view>

		<image style="width: 40rpx; height: 40rpx" :src="$rightIcon" mode=""></image>
	</view>
</template>

<script>
export default {
	name: 'major-job-cell',
	props: {
		// 需要显示的数据
		item: {
			type: Object,
			default: {}
		},
		/**
		 * @description 0: 专业， 1： 职业
		 */
		type: {
			type: Number,
			default: 0
		}
	},
	data() {
		return {};
	},
	methods: {
		/**
		 * @description 跳转到页面
		 * @param {Object} code 要跳转到的code
		 */
		onToPage(code) {
			let url = this.type
				? `/subpackages/subpackage1/pages/seejob/seejobdetail?code=${code}`
				: `/subpackages/subpackage1/pages/searchmajor/search-major-majordetail?code=${code}`;

			uni.navigateTo({
				url
			});
		}
	}
};
</script>

<style lang="scss">
.major-box {
	display: flex;
	justify-content: space-between;
	align-items: center;
	box-sizing: border-box;
	margin: 24rpx 32rpx 0 32rpx;
	background: #ffffff;
	border-radius: 10rpx;
	padding: 32rpx;

	image {
		width: 20rpx;
		height: 30rpx;
	}
}

.major-item {
	width: 70%;
	height: 100rpx;
	display: flex;
	justify-content: center;
	flex-direction: column;

	.title {
		font-size: 32rpx;
		color: #464646;
		font-weight: bold;
	}

	.minor-text {
		margin-top: 10rpx;
		font-size: 24rpx;
		color: #333333;
		font-weight: bold;
	}
}
</style>
